#ifndef GAMEMANAGER_H_
#define GAMEMANAGER_H_

#include "Object.h"
#include "ObjectList.h"
#include "StringList.h"
#include "AbrahamLincoln.h"
#include "Border.h"
#include "TextureManager.h"
#include "MaterialManager.h"
#include "LevelManager.h"
#include "PrintManager.h"
#include "Camera.h"
#include "MenuManager.h"
#include "StatusBarElement.h"
#include "SpriteList.h"
#include "SupplyBag.h"
#include "Dictionary.h"
#include "ConversationBox.h"

class GameManager
{
	SupplyBag supplyBag;
	ObjectList * featureList;
	ObjectList * objectList;
	StringList * stringList;
	SpriteList * spriteList;
	
	Dictionary * gameState;
	
	ConversationBox * conversationBox;
	StatusBarElement * healthBar;
	
	Camera * camera;
	Border * testBorder;
	
	//MaterialManager materialManager;
	//TextureManager textureManager;
	LevelManager levelManager;
	PrintManager printManager;
	MenuManager menuManager;
	MenuManager guiManager;
	//Object * testObject;
	//Object * testObject2;
	float lastThoughtTimestamp;
	time_t lastTime;
	AbrahamLincoln * player;
	bool m_pause;
	bool m_escKeyDepressed;
	bool m_upKeyDepressed;
	bool m_downKeyDepressed;
	bool m_leftKeyDepressed;
	bool m_rightKeyDepressed;
	bool m_jumpKeyDepressed;
	bool m_jumpKeyWasDepressed;
	bool m_actionKeyDepressed;
	bool m_actionKeyWasDepressed;
	bool m_leftArrowDepressed;
	bool m_rightArrowDepressed;
	bool m_upArrowDepressed;
	bool m_downArrowDepressed;
	bool m_rightMouseDepressed;
	bool m_leftMouseDepressed;
	bool m_leftMouseWasDepressed;
	bool m_rightMouseWasDepressed;
	bool m_grenadeKeyDepressed;
	bool m_grenadeKeyWasDepressed;
	Vector2D m_mouseLocation;
	void Init(char * directory);
	void CreateMainMenu();
	void CreateLevelMenu();
	void CreateGui();
	void ShowConversationBox(Object * object, char * conversation);
	void CreateConversationBox();
	void TextBoxClicked();
	void SetLoadLevel(char * level);
	void StartLevel();
	void LoadSelectedLevel();
	void QuitLevel();
	void ShowLevelMenu();
	void ShowMainMenu();
	bool isInLevel;
	
	
public:

	char * levelToLoad;
	bool exit;
	bool isInMenu;
	bool isInConversation;
	GameManager();
	~GameManager();
	void Cancel();
	void SetUserInput(double x, double y);
	void SetUserInput(int button, bool isDepressed, int x, int y);
	void SetUserInput(int key, bool depressed);
	void SetUserInput(unsigned char key, bool depressed);
	void HandleUserInput();
	void Draw();
	void Move(float elapsedTime);
	void Interact(double elapsedTime);
	void PrepareFrame();	
	Vector2D GetCameraSize();
	bool IsPlaySuspended();
};

#endif /*GAMEMANAGER_H_*/
